#ifndef	QUEUE_H
#define	QUEUE_H

#include	"IBase.h"
#include	"Array.h"

class	Queue : public IBase
{

public:
	Queue( const char * theName ) : IBase( theName ) {}

	void	put( IBase * object )
	{
		items.insert ( object );
	}

	void	putNoRetain( IBase * object )
	{
		items.insertNoGrab( object );
	}

	IBase * get()
	{
		IBase * object = items.at( 0 );

		if ( object == NULL ) return NULL;

		object->grab();

		items.removeAtIndex( 0 );

		return object;
	}

	void	Clear()
	{
		items.removeAll();
	}

protected:
	Array	items;
};

#endif